﻿using System.Web;
using System.Web.Routing;


namespace VietPremier.Repository
{
    public class TravelInformationRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "TravelInformation" && (string)values["action"] == "Information")
                return true;

            return false;
        }
    }

    public class AboutUsRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "AboutUs" && (string)values["action"] == "Index")
                return true;

            return false;
        }
    }

    public class InquiryNowRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Inquiry" && (string)values["action"] == "Index")
                return true;

            return false;
        }
    }

    public class PromotionRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Promotion" && (string)values["action"] == "Index")
                return true;

            return false;
        }
    }

    public class DetailPromotionRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Promotion" && (string)values["action"] == "Detail")
                return true;

            return false;
        }
    }

    public class TravelProductRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "TravelInformation" && (string)values["action"] == "Product")
                return true;

            return false;
        }
    }

    public class TravelCityRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "TravelInformation" && (string)values["action"] == "City")
                return true;

            return false;
        }
    }

    public class TravelHotelRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "TravelInformation" && (string)values["action"] == "Hotel")
                return true;

            return false;
        }
    }

    public class TravelStyleRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Style" && (string)values["action"] == "TravelStyle")
                return true;

            return false;
        }
    }

    public class TravelStyleDetailRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Style" && (string)values["action"] == "TravelDetail")
                return true;

            return false;
        }
    }

    public class IndexDestinationRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Destination" && (string)values["action"] == "Index")
                return true;

            return false;
        }
    }

    public class DestinationCountryListRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Destination" && (string)values["action"] == "DestinationCountryList")
                return true;

            return false;
        }
    }

    public class DestinationRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Destination" && (string)values["action"] == "Destination")
                return true;

            return false;
        }
    }

    public class DestinationDetailRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Destination" && (string)values["action"] == "DestinationDetail")
                return true;

            return false;
        }
    }

    public class News_EventDetailRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if ((string)values["controller"] == "Home" && (string)values["action"] == "News_EventDetail")
                return true;

            return false;
        }
    }

}